Skip to content

Conversation

@adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Nov 28, 2024

Question Answer
JIRA Ticket
Versions
Edition

Fix personalization event names capitalization and code style.

Preview: https://ez-systems-developer-documentation--2554.com.readthedocs.build/en/2554/personalization/api_reference/tracking_api/

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

Comment on lines 361 to 362
{
"recommendationItems": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide a full response here, in an external file, not an extract. And, if needed, highlight lines related to the topic.

}
}
]
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


See [Recommendation API](recommendation_api.md) for more details.

A trigger message includes requests for a Triggeropened and Clicktriggered event.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use the properties of the trigger message below, triggerOpenedLink and clickTriggered?

A recommendation response includes requests to generate a Rendered and Clickrecommended event.
The first one is executed when a recommendation is shown to the user.
The second is called when a recommendation is clicked or otherwise accepted.
Sending Rendered events causes as many requests as recommendations to be displayed, a Clickrecommended event is usually sent only once (when a user clicks on a specific recommendation item).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not "clickRecommended" has in the example below?

Suggested change
Sending Rendered events causes as many requests as recommendations to be displayed, a Clickrecommended event is usually sent only once (when a user clicks on a specific recommendation item).
Sending Rendered events causes as many requests as recommendations to be displayed, a `clickRecommended` event is usually sent only once (when a user clicks on a specific recommendation item).

It's probably its label name instead of its property name. Could be "Click recommended" in this case, a bit like "Clicked recommended" from its summary https://github.com/ibexa/personalization/blob/v4.6.14/src/lib/Value/Performance/Summary/Event.php#L19

Or all-caps "CLICKRECOMMENDED" like in https://doc.ibexa.co/projects/userguide/en/master/personalization/event_types/

Comment on lines 378 to 379
Example of a trigger message:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is again a JSON sample without consideration for parse errors.
I didn't find a test or other reference for this one.

@github-actions
Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/personalization/response-body.json


code_samples/personalization/response-body.json

docs/personalization/api_reference/tracking_api.md@360:``` json
docs/personalization/api_reference/tracking_api.md@361:[[= include_file('code_samples/personalization/response-body.json', 1, 16) =]]
docs/personalization/api_reference/tracking_api.md@362:```

001⫶ "recommendationItems": [
002⫶ {
003⫶ "relevance": 23,
004⫶ "itemType": 1,
005⫶ "itemId": 100175717,
006⫶ "origin": {
007⫶ "itemIds" : [10, 11],
008⫶ "itemType" : 1,
009⫶ "source" : "REQUEST"
010⫶ },
011⫶ "category" : "Men/Shirts",
012⫶ "links" : {
013⫶ "clickRecommended" : "//event.perso.ibexa.co/clickrecommended/johndoe/1/100175717?scenario=also_clicked&modelId=37",
014⫶ "rendered" : "//event.perso.ibexa.co/rendered/johndoe/1/100175717"
015⫶ }

Download colorized diff

@mnocon mnocon changed the base branch from master to 5.0 May 19, 2025 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant